<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>CSS3 3D旋转</title>
  <style>
    body {
      perspective: 500px;
    }

    .box {
      position: relative;
      width: 200px;
      height: 200px;
      margin: 100px auto;
      transform-style: preserve-3d;
      transition: all 1.5s;
    }

    .box:hover {
      transform: rotateY(-60deg);
    }

    .box div {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: pink;
    }

    .box div:last-child {
      background-color: skyblue;
      transform: rotateX(60deg);
    }
  </style>
</head>
<body>
  <div class="box">
    <div></div>
    <div></div>
  </div>
</body>
</html>